import 'package:flutter/material.dart';
import 'package:ls_work/a_elder/models/upload_entity.dart';
import 'package:ls_work/a_mine/page/add_qualifications_page.dart';
import 'package:ls_work/login/page/user_manager.dart';
import 'package:ls_work/net/net.dart';
import 'package:ls_work/res/colors.dart';
import 'package:ls_work/res/styles.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:ls_work/util/app_navigator.dart';
import 'package:ls_work/util/utils.dart';

class MeCerCell extends StatelessWidget {
  final Upload? info;
  final int? type;
  MeCerCell({Key? key, this.info,this.type});
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        AppNavigator.push(context, AddQualificationsPage(info: info,type: type,));
      },
      child: Container(
        padding: EdgeInsets.all(12),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Expanded(
              child: Text(
                info?.fileDesc??"",
                style: TextStyles.textDark16,
              ),
            ),
            Container(
              width: 40,
              height: 40,
              child: CachedNetworkImage(
                width: 40,
                height: 40,
                fit: BoxFit.fill,
                httpHeaders: {"Cookie":UserManager.cookieStr},
                imageUrl: '${HttpApi.imageHead}${info?.fileId}',
                placeholder: (context, url) => new ProgressView(),
                errorWidget: (context, url, error) => new Icon(Icons.error),
              ),
              decoration: BoxDecoration(
                color: Colours.bg_color,
                borderRadius: BorderRadius.circular(5),
              ),
            ),
            SizedBox(
              width: 10,
            ),
            Icon(
              Icons.arrow_forward_ios,
              color: Colours.text_gray,
              size: 15,
            ),
          ],
        ),
      ),
    );
  }
}
